package Collection;

import java.util.ArrayList;


/**
 * @author wuhan
 * @date 2019/9/26 20:24
 */



interface Inter<T>{
    void show(T t);
}
class InterImpl <T> implements  Inter<T>{

    @Override
    public void show(T t) {
        System.out.println("show:"+t);
    }
}
public class GenericDemo1 {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<>();
        arrayList.add("asd");
        arrayList.add("asd");
        arrayList.add("asd");
        ArrayList<Integer> arrayList1=new ArrayList<>();
        arrayList1.add(3);
        arrayList1.add(4);
        arrayList1.add(5);
        printColl(arrayList1);
        printColl(arrayList);

    }

    private static <T> void printColl(ArrayList<T> arrayList){
        for (T t : arrayList) {
            System.out.println(t);
        }
    }
}
